Electronic device for matching antenna impedance and operating method thereof

ABSTRACT

Various embodiments of an electronic device for matching an antenna impedance may include an antenna, a wireless communication module, an impedance matching module, and at least one processor, wherein the at least one processor is configured to: select a first index corresponding to an impedance of the antenna among a plurality of sampled indexes through a first measurement in which a tuning code of the impedance matching module is configured as a reference code; identify a use environment corresponding to the first index; select a second index corresponding to the impedance of the antenna among the plurality of sampled indexes through a second measurement in which the tuning code of the impedance matching module is configured as the reference code and as a ground code corresponding to the use environment; and adjust the impedance of the antenna based on a tuning code corresponding to the second index.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based on and claims priority under 35 U.S.C. § 119to Korean Patent Application No. 10-2019-0117078 filed on Sep. 23, 2019in the Korean Intellectual Property Office, the disclosure of which isherein incorporated by reference in its entirety.

BACKGROUND 1. Field

Various embodiments of the disclosure relate to an apparatus and amethod for matching antenna impedance in an electronic device.

2. Description of Related Art

An electronic device may perform a wireless communication with anexternal electronic device using at least one antenna. Impedance of anantenna may exert an influence on a transmission efficiency of theantenna for wireless communication. For example, in an electronicdevice, a loss (e.g., reflection loss), which is caused by at least apart of a transmission signal being reflected without being emitted, mayoccur due to a difference in impedance between an antenna and a frontend unit (FEU) that transmits a signal to the antenna.

In order to increase the transmission efficiency of the antenna, theelectronic device may match the impedance of the antenna. For example,the impedance matching may mean an operation capable of performing amaximum power transfer transmission to an antenna by matching theimpedance of the antenna, which is changed in accordance with variouspropagation environments or use environments of the electronic device,with the characteristic impedance.

SUMMARY

An electronic device may perform an antenna impedance matching byapplying a tuning code corresponding to the impedance of the antenna.For example, the tuning code corresponding to the impedance of theantenna may include a tuning code corresponding to any one index closestto the impedance of the antenna among a plurality (e.g., 25) of sampledindexes.

However, in case of selecting the tuning code corresponding to theimpedance of the antenna, configuration of a ground controlling thelength of the antenna is excluded, and thus there may be a problem thatthe electronic device is unable to select the optimum tuning code thatcan match the antenna impedance with the characteristic impedance.

Various embodiments of the disclosure disclose an apparatus and a methodfor selecting an optimum tuning code for matching the antenna impedancein an electronic device.

According to various embodiments of the disclosure, an electronic devicemay include: an antenna; a wireless communication module; an impedancematching module electrically connected to the antenna and the wirelesscommunication module; and at least one processor operatively connectedto the impedance matching module and the wireless communication module,wherein the at least one processor is configured to: select a firstindex corresponding to an impedance of the antenna among a plurality ofsampled indexes through a first measurement in which a tuning code ofthe impedance matching module is configured as a reference code,identify a use environment corresponding to the first index, select asecond index corresponding to the impedance of the antenna among theplurality of sampled indexes through a second measurement in which thetuning code of the impedance matching module is configured as thereference code and as a ground code corresponding to the useenvironment, and adjust the impedance of the antenna based on a tuningcode corresponding to the second index.

According to various embodiments of the disclosure, an electronic devicemay include: an antenna; a wireless communication module; an impedancematching module electrically connected to the antenna and the wirelesscommunication module; and at least one processor operatively connectedto the impedance matching module and the wireless communication module,wherein the at least one processor is configured to: select a firstindex corresponding to a first impedance of the antenna identifiedthrough a first measurement, in which a tuning code of the impedancematching module is configured as a reference code, among a plurality ofsampled indexes, identify a use environment corresponding to the firstindex, identify a second impedance of the antenna through a secondmeasurement in which the tuning code of the impedance matching module isconfigured as a tuning code corresponding to the first index and as aground code corresponding to the use environment, and adjust theimpedance of the antenna based on the tuning code corresponding to thefirst index in case that a distance between the second impedance and areference impedance satisfies a designated condition.

According to various embodiments of the disclosure, a method foroperating an electronic device may include: selecting a first indexcorresponding to an impedance of an antenna among a plurality of sampledindexes through a first measurement in which a tuning code for impedancematching of the antenna is configured as a reference code; identifying ause environment corresponding to the first index; selecting a secondindex corresponding to the impedance of the antenna among the pluralityof sampled indexes through a second measurement in which the tuning codefor the impedance matching of the antenna is configured as the referencecode and as a ground code corresponding to the use environment; andadjusting the impedance of the antenna based on a tuning codecorresponding to the second index.

According to various embodiments of the disclosure, a method foroperating an electronic device may include: selecting a first indexcorresponding to a first impedance of an antenna identified through afirst measurement, in which a tuning code for impedance matching of theantenna is configured as a reference code, among a plurality of sampledindexes; identifying a use environment corresponding to the first index;identifying a second impedance of the antenna through a secondmeasurement in which the tuning code for the impedance matching of theantenna is configured as a tuning code corresponding to the first indexand as a ground code corresponding to the use environment; and adjustingthe impedance of the antenna based on the tuning code corresponding tothe first index in case that a distance between the second impedance anda reference impedance satisfies a designated condition.

Effects that can be obtained in the disclosure are not limited to theabove-described effects, and other unmentioned effects can be clearlyunderstood by those of ordinary skill in the art to which the disclosurepertains from the following description.

Before undertaking the DETAILED DESCRIPTION below, it may beadvantageous to set forth definitions of certain words and phrases usedthroughout this patent document: the terms “include” and “comprise,” aswell as derivatives thereof, mean inclusion without limitation; the term“or,” is inclusive, meaning and/or; the phrases “associated with” and“associated therewith,” as well as derivatives thereof, may mean toinclude, be included within, interconnect with, contain, be containedwithin, connect to or with, couple to or with, be communicable with,cooperate with, interleave, juxtapose, be proximate to, be bound to orwith, have, have a property of, or the like; and the term “controller”means any device, system or part thereof that controls at least oneoperation, such a device may be implemented in hardware, firmware orsoftware, or some combination of at least two of the same. It should benoted that the functionality associated with any particular controllermay be centralized or distributed, whether locally or remotely.

As used herein, the term “module” may include a unit implemented inhardware, software, or firmware, and may interchangeably be used withother terms, for example, “logic,” “logic block,” “part,” or“circuitry.” A module may be a single integral component, or a minimumunit or part thereof, adapted to perform one or more functions. Forexample, according to an embodiment, the module may be implemented in aform of an application-specific integrated circuit (ASIC).

Moreover, various functions described below can be implemented orsupported by one or more computer programs, each of which is formed fromcomputer readable program code and embodied in a computer readablemedium. The terms “application” and “program” refer to one or morecomputer programs, software components, sets of instructions,procedures, functions, objects, classes, instances, related data, or aportion thereof adapted for implementation in a suitable computerreadable program code. The phrase “computer readable program code”includes any type of computer code, including source code, object code,and executable code. The phrase “computer readable medium” includes anytype of medium capable of being accessed by a computer, such as readonly memory (ROM), random access memory (RAM), a hard disk drive, acompact disc (CD), a digital video disc (DVD), or any other type ofmemory. A “non-transitory” computer readable medium excludes wired,wireless, optical, or other communication links that transporttransitory electrical or other signals. A non-transitory computerreadable medium includes media where data can be permanently stored andmedia where data can be stored and later overwritten, such as arewritable optical disc or an erasable memory device.

Definitions for certain words and phrases are provided throughout thispatent document, those of ordinary skill in the art should understandthat in many, if not most instances, such definitions apply to prior, aswell as future uses of such defined words and phrases.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present disclosure and itsadvantages, reference is now made to the following description taken inconjunction with the accompanying drawings, in which like referencenumerals represent like parts:

FIG. 1 is a block diagram of an electronic device in a networkenvironment according to various embodiments;

FIG. 2 is a block diagram of an electronic device for matching anantenna impedance according to various embodiments;

FIG. 3A is a graph illustrating 25 sampled indexes corresponding to anantenna impedance according to various embodiments;

FIG. 3B is a graph illustrating 96 sampled indexes corresponding to anantenna impedance according to various embodiments;

FIG. 4 is a graph illustrating a reference impedance according tovarious embodiments;

FIG. 5 is a flowchart in which an electronic device according to variousembodiments matches an antenna impedance;

FIG. 6 is a graph for selecting a tuning code according to variousembodiments;

FIG. 7 is a graph illustrating a use environment of an electronic deviceaccording to various embodiments;

FIG. 8 is a diagram illustrating a period for measuring an antennaimpedance according to various embodiments;

FIG. 9 is a flowchart in which an electronic device according to variousembodiments updates a tuning code;

FIG. 10 is a flowchart in which an electronic device according tovarious embodiments determines whether to use a tuning codecorresponding to a first measurement;

FIG. 11 is a flowchart in which an electronic device according tovarious embodiments selects a tuning code through a second measurement;and

FIG. 12 is a flowchart in which an electronic device according tovarious embodiments configures a tuning code based on a received signalstrength.

DETAILED DESCRIPTION

FIGS. 1 through 12, discussed below, and the various embodiments used todescribe the principles of the present disclosure in this patentdocument are by way of illustration only and should not be construed inany way to limit the scope of the disclosure. Those skilled in the artwill understand that the principles of the present disclosure may beimplemented in any suitably arranged system or device.

Hereinafter, various embodiments will be described in detail withreference to the accompanying drawings.

FIG. 1 is a block diagram illustrating an electronic device 101 in anetwork environment 100 according to various embodiments. Referring toFIG. 1, the electronic device 101 in the network environment 100 maycommunicate with an electronic device 102 via a first network 198 (e.g.,a short-range wireless communication network), or an electronic device104 or a server 108 via a second network 199 (e.g., a long-rangewireless communication network). According to an embodiment, theelectronic device 101 may communicate with the electronic device 104 viathe server 108. According to an embodiment, the electronic device 101may include a processor 120, memory 130, an input device 150, a soundoutput device 155, a display device 160, an audio module 170, a sensormodule 176, an interface 177, a haptic module 179, a camera module 180,a power management module 188, a battery 189, a communication module190, a subscriber identification module (SIM) 196, or an antenna module197. In some embodiments, at least one (e.g., the display device 160 orthe camera module 180) of the components may be omitted from theelectronic device 101, or one or more other components may be added inthe electronic device 101. In some embodiments, some of the componentsmay be implemented as single integrated circuitry. For example, thesensor module 176 (e.g., a fingerprint sensor, an iris sensor, or anilluminance sensor) may be implemented as embedded in the display device160 (e.g., a display).

The processor 120 may execute, for example, software (e.g., a program140) to control at least one other component (e.g., a hardware orsoftware component) of the electronic device 101 coupled with theprocessor 120, and may perform various data processing or computation.According to an example embodiment, as at least part of the dataprocessing or computation, the processor 120 may load a command or datareceived from another component (e.g., the sensor module 176 or thecommunication module 190) in volatile memory 132, process the command orthe data stored in the volatile memory 132, and store resulting data innon-volatile memory 134. According to an embodiment, the processor 120may include a main processor 121 (e.g., a central processing unit (CPU)or an application processor (AP)), and an auxiliary processor 123 (e.g.,a graphics processing unit (GPU), an image signal processor (ISP), asensor hub processor, or a communication processor (CP)) that isoperable independently from, or in conjunction with, the main processor121. Additionally or alternatively, the auxiliary processor 123 may beadapted to consume less power than the main processor 121, or to bespecific to a specified function. The auxiliary processor 123 may beimplemented as separate from, or as part of the main processor 121.

The auxiliary processor 123 may control at least some of functions orstates related to at least one component (e.g., the display device 160,the sensor module 176, or the communication module 190) among thecomponents of the electronic device 101, instead of the main processor121 while the main processor 121 is in an inactive (e.g., sleep) state,or together with the main processor 121 while the main processor 121 isin an active state (e.g., executing an application). According to anembodiment, the auxiliary processor 123 (e.g., an image signal processoror a communication processor) may be implemented as part of anothercomponent (e.g., the camera module 180 or the communication module 190)functionally related to the auxiliary processor 123.

The memory 130 may store various data used by at least one component(e.g., the processor 120 or the sensor module 176) of the electronicdevice 101. The various data may include, for example, software (e.g.,the program 140) and input data or output data for a command relatedthereto. The memory 130 may include the volatile memory 132 or thenon-volatile memory 134.

The program 140 may be stored in the memory 130 as software, and mayinclude, for example, an operating system (OS) 142, middleware 144, oran application 146.

The input device 150 may receive a command or data to be used by othercomponent (e.g., the processor 120) of the electronic device 101, fromthe outside (e.g., a user) of the electronic device 101. The inputdevice 150 may include, for example, a microphone, a mouse, a keyboard,or a digital pen (e.g., stylus pen).

The sound output device 155 may output sound signals to the outside ofthe electronic device 101. The sound output device 155 may include, forexample, a speaker or a receiver. The speaker may be used for generalpurposes, such as playing multimedia or playing record, and the receivermay be used for an incoming calls. According to an embodiment, thereceiver may be implemented as separate from, or as part of the speaker.

The display device 160 may visually provide information to the outside(e.g., a user) of the electronic device 101. The display device 160 mayinclude, for example, a display, a hologram device, or a projector andcontrol circuitry to control a corresponding one of the display,hologram device, and projector. According to an embodiment, the displaydevice 160 may include touch circuitry adapted to detect a touch, orsensor circuitry (e.g., a pressure sensor) adapted to measure theintensity of force incurred by the touch.

The audio module 170 may convert a sound into an electrical signal andvice versa. According to an embodiment, the audio module 170 may obtainthe sound via the input device 150, or output the sound via the soundoutput device 155 or a headphone of an external electronic device (e.g.,an electronic device 102) directly (e.g., wiredly) or wirelessly coupledwith the electronic device 101.

The sensor module 176 may detect an operational state (e.g., power ortemperature) of the electronic device 101 or an environmental state(e.g., a state of a user) external to the electronic device 101, andthen generate an electrical signal or data value corresponding to thedetected state. According to an embodiment, the sensor module 176 mayinclude, for example, a gesture sensor, a gyro sensor, an atmosphericpressure sensor, a magnetic sensor, an acceleration sensor, a gripsensor, a proximity sensor, a color sensor, an infrared (IR) sensor, abiometric sensor, a temperature sensor, a humidity sensor, or anilluminance sensor.

The interface 177 may support one or more specified protocols to be usedfor the electronic device 101 to be coupled with the external electronicdevice (e.g., the electronic device 102) directly (e.g., wiredly) orwirelessly. According to an embodiment, the interface 177 may include,for example, a high definition multimedia interface (HDMI), a universalserial bus (USB) interface, a secure digital (SD) card interface, or anaudio interface.

A connecting terminal 178 may include a connector via which theelectronic device 101 may be physically connected with the externalelectronic device (e.g., the electronic device 102). According to anembodiment, the connecting terminal 178 may include, for example, a HDMIconnector, a USB connector, a SD card connector, or an audio connector(e.g., a headphone connector).

The haptic module 179 may convert an electrical signal into a mechanicalstimulus (e.g., a vibration or a movement) or electrical stimulus whichmay be recognized by a user via his tactile sensation or kinestheticsensation. According to an embodiment, the haptic module 179 mayinclude, for example, a motor, a piezoelectric element, or an electricstimulator.

The camera module 180 may capture a still image or moving images.According to an embodiment, the camera module 180 may include one ormore lenses, image sensors, image signal processors, or flashes.

The power management module 188 may manage power supplied to theelectronic device 101. According to an example embodiment, the powermanagement module 188 may be implemented as at least part of, forexample, a power management integrated circuit (PMIC).

The battery 189 may supply power to at least one component of theelectronic device 101. According to an embodiment, the battery 189 mayinclude, for example, a primary cell which is not rechargeable, asecondary cell which is rechargeable, or a fuel cell.

The communication module 190 may support establishing a direct (e.g.,wired) communication channel or a wireless communication channel betweenthe electronic device 101 and the external electronic device (e.g., theelectronic device 102, the electronic device 104, or the server 108) andperforming communication via the established communication channel. Thecommunication module 190 may include one or more communicationprocessors that are operable independently from the processor 120 (e.g.,the application processor (AP)) and supports a direct (e.g., wired)communication or a wireless communication. According to an embodiment,the communication module 190 may include a wireless communication module192 (e.g., a cellular communication module, a short-range wirelesscommunication module, or a global navigation satellite system (GNSS)communication module) or a wired communication module 194 (e.g., a localarea network (LAN) communication module or a power line communication(PLC) module). A corresponding one of these communication modules maycommunicate with the external electronic device via the first network198 (e.g., a short-range communication network, such as Bluetooth™,wireless-fidelity (Wi-Fi) direct, or infrared data association (IrDA))or the second network 199 (e.g., a long-range communication network,such as a cellular network, the Internet, or a computer network (e.g.,LAN or wide area network (WAN)). These various types of communicationmodules may be implemented as a single component (e.g., a single chip),or may be implemented as multi components (e.g., multi chips) separatefrom each other. The wireless communication module 192 may identify andauthenticate the electronic device 101 in a communication network, suchas the first network 198 or the second network 199, using subscriberinformation (e.g., international mobile subscriber identity (IMSI))stored in the subscriber identification module 196.

The antenna module 197 may transmit or receive a signal or power to orfrom the outside (e.g., the external electronic device) of theelectronic device 101. According to an embodiment, the antenna module197 may include an antenna including a radiating element composed of aconductive material or a conductive pattern formed in or on a substrate(e.g., PCB). According to an embodiment, the antenna module 197 mayinclude a plurality of antennas. In such a case, at least one antennaappropriate for a communication scheme used in the communicationnetwork, such as the first network 198 or the second network 199, may beselected, for example, by the communication module 190 (e.g., thewireless communication module 192) from the plurality of antennas. Thesignal or the power may then be transmitted or received between thecommunication module 190 and the external electronic device via theselected at least one antenna. According to an embodiment, anothercomponent (e.g., a radio frequency integrated circuit (RFIC)) other thanthe radiating element may be additionally formed as part of the antennamodule 197.

At least some of the above-described components may be coupled mutuallyand communicate signals (e.g., commands or data) therebetween via aninter-peripheral communication scheme (e.g., a bus, general purposeinput and output (GPIO), serial peripheral interface (SPI), or mobileindustry processor interface (MIPI)).

According to an embodiment, commands or data may be transmitted orreceived between the electronic device 101 and the external electronicdevice 104 via the server 108 coupled with the second network 199. Eachof the external electronic devices 102 and 104 may be a device of a sametype as, or a different type, from the electronic device 101. Accordingto an embodiment, all or some of operations to be executed at theelectronic device 101 may be executed at one or more of the externalelectronic devices 102, 104, or 108. For example, if the electronicdevice 101 should perform a function or a service automatically, or inresponse to a request from a user or another device, the electronicdevice 101, instead of, or in addition to, executing the function or theservice, may request the one or more external electronic devices toperform at least part of the function or the service. The one or moreexternal electronic devices receiving the request may perform the atleast part of the function or the service requested, or an additionalfunction or an additional service related to the request, and transferan outcome of the performing to the electronic device 101. Theelectronic device 101 may provide the outcome, with or without furtherprocessing of the outcome, as at least part of a reply to the request.To that end, a cloud computing, distributed computing, or client-servercomputing technology may be used, for example.

The electronic device according to certain embodiments may be one ofvarious types of electronic devices. The electronic devices may include,for example, a portable communication device (e.g., a smart phone), acomputer device, a portable multimedia device, a portable medicaldevice, a camera, a wearable device, or a home appliance. According toan embodiment of the disclosure, the electronic devices are not limitedto those described above.

It should be appreciated that certain embodiments of the presentdisclosure and the terms used therein are not intended to limit thetechnological features set forth herein to particular embodiments andinclude various changes, equivalents, or replacements for acorresponding embodiment. With regard to the description of thedrawings, similar reference numerals may be used to refer to similar orrelated elements. It is to be understood that a singular form of a nouncorresponding to an item may include one or more of the things, unlessthe relevant context clearly indicates otherwise. As used herein, eachof such phrases as “A or B,” “at least one of A and B,” “at least one ofA or B,” “A, B, or C,” “at least one of A, B, and C,” and “at least oneof A, B, or C,” may include all possible combinations of the itemsenumerated together in a corresponding one of the phrases. As usedherein, such terms as “1st” and “2nd,” or “first” and “second” may beused to simply distinguish a corresponding component from another, anddoes not limit the components in other aspect (e.g., importance ororder). It is to be understood that if an element (e.g., a firstelement) is referred to, with or without the term “operatively” or“communicatively”, as “coupled with,” “coupled to,” “connected with,” or“connected to” another element (e.g., a second element), it means thatthe element may be coupled with the other element directly (e.g.,wiredly), wirelessly, or via a third element.

As used herein, the term “module” may include a unit implemented inhardware, software, or firmware, and may interchangeably be used withother terms, for example, “logic,” “logic block,” “part,” or“circuitry”. A module may be a single integral component, or a minimumunit or part thereof, adapted to perform one or more functions. Forexample, according to an embodiment, the module may be implemented in aform of an application-specific integrated circuit (ASIC).

Certain embodiments as set forth herein may be implemented as software(e.g., the program 140) including one or more instructions that arestored in a storage medium (e.g., internal memory 136 or external memory138) that is readable by a machine (e.g., the electronic device 101).For example, a processor (e.g., the processor 120) of the machine (e.g.,the electronic device 101) may invoke at least one of the one or moreinstructions stored in the storage medium, and execute it, with orwithout using one or more other components under the control of theprocessor. This allows the machine to be operated to perform at leastone function according to the at least one instruction invoked. The oneor more instructions may include a code generated by a compiler or acode executable by an interpreter. The machine-readable storage mediummay be provided in the form of a non-transitory storage medium. The term“non-transitory” simply means that the storage medium is a tangibledevice, and does not include a signal (e.g., an electromagnetic wave),but this term does not differentiate between where data issemi-permanently stored in the storage medium and where the data istemporarily stored in the storage medium.

According to an embodiment, a method according to certain embodiments ofthe disclosure may be included and provided in a computer programproduct. The computer program product may be traded as a product betweena seller and a buyer. The computer program product may be distributed inthe form of a machine-readable storage medium (e.g., compact disc readonly memory (CD-ROM)), or be distributed (e.g., downloaded or uploaded)online via an application store (e.g., Play Store™), or between two userdevices (e.g., smart phones) directly. If distributed online, at leastpart of the computer program product may be temporarily generated or atleast temporarily stored in the machine-readable storage medium, such asmemory of the manufacturer's server, a server of the application store,or a relay server.

According to certain embodiments, each component (e.g., a module or aprogram) of the above-described components may include a single entityor multiple entities. According to certain embodiments, one or more ofthe above-described components may be omitted, or one or more othercomponents may be added. Alternatively or additionally, a plurality ofcomponents (e.g., modules or programs) may be integrated into a singlecomponent. In such a case, according to certain embodiments, theintegrated component may still perform one or more functions of each ofthe plurality of components in the same or similar manner as they areperformed by a corresponding one of the plurality of components beforethe integration. According to certain embodiments, operations performedby the module, the program, or another component may be carried outsequentially, in parallel, repeatedly, or heuristically, or one or moreof the operations may be executed in a different order or omitted, orone or more other operations may be added

FIG. 2 is a block diagram of an electronic device 200 for matchingantenna impedance according to various embodiments. Hereinafter, atleast parts of the configuration of FIG. 2 will be described withreference to FIG. 3A, 3B, or 4. FIG. 3A is a graph illustrating 25sampled indexes corresponding to an antenna impedance according tovarious embodiments. FIG. 3B is a graph illustrating 96 sampled indexescorresponding to an antenna impedance according to various embodiments.FIG. 4 is a graph illustrating a reference impedance according tovarious embodiments.

With reference to FIG. 2, an electronic device 200 may include aprocessor (e.g., including processing circuitry) 210, a wirelesscommunication module (e.g., wireless communication circuitry) 220, aswitch 230, an impedance matching module (e.g., impedance matchingcircuitry) 240, a ground control module (e.g., ground control circuitry)250, and at least one antenna 260. According to an embodiment, theprocessor 210 may be substantially the same as the processor 120 of FIG.1, or may be included in the processor 120. The wireless communicationmodule 220 may be substantially the same as the wireless communicationmodule 192 of FIG. 1, or may be included in the wireless communicationmodule 192. At least one of the switch 230, the impedance matchingmodule 240, or the ground control module 250 may be included in thewireless communication module 192.

According to various embodiments, the processor 210 may be electrically(or operatively) connected to other constituent elements (e.g., thewireless communication module 220, the switch 230, the impedancematching module 240, or the ground control module 250) to control theconstituent elements, and may perform processing and operating ofvarious kinds of data.

According to various embodiments, the processor 210 may select a tuningcode of the impedance matching module 240 based on ground configurationcorresponding to a use environment of the electronic device 200. As anexample, the tuning code of the impedance matching module 240 mayindicate a tuning code for matching an impedance of the antenna 260 witha reference impedance.

According to an embodiment, the processor 210 may identify the antennaimpedance of the electronic device 200 through a first measurementconfiguring the tuning code of the impedance matching module 240 as areference code (e.g., bypass code). The processor 210 may estimate a useenvironment of the electronic device 200 based on an index correspondingto the antenna impedance identified through the first measurement. As anexample, the index corresponding to the antenna impedance may includeany one index having the shortest distance to the coordinates of theantenna impedance identified through the first measurement among 25sampled indexes as shown in FIG. 3A or 96 sampled indexes as shown inFIG. 3B. The processor 210 may select a tuning code to be applied to theimpedance matching module 240 through a second measurement to which aground code corresponding to the use environment of the electronicdevice 200 is applied. As an example, the tuning code to be applied tothe impedance matching module 240 may include a tuning codecorresponding to any one index having the closest distance to thecoordinates of the antenna impedance obtained through the secondmeasurement among the 25 sampled indexes as shown in FIG. 3A or the 96sampled indexes as shown in FIG. 3B. As an example, the tuning code ofthe impedance matching module 240 may be configured as the referencecode during the second measurement. As an example, the processor 210 mayselect (or update) the tuning code based on the second measurement in astate where the index obtained through the first measurement is equallymaintained. As an example, the processor 210 may include a communicationprocessor (CP) or an application processor (AP).

According to an embodiment, the processor 210 may perform the firstmeasurement for identifying an impedance change of the antenna 260 ofthe electronic device 200. As an example, during the first measurement,the tuning code of the impedance matching module 240 may be configuredas the reference code (e.g., bypass code). The processor 210 may detectthe index corresponding to the antenna impedance identified through thefirst measurement, and may identify the tuning code and the ground codecorresponding to the detected index. Through the second measurementbased on the result of the first measurement, the processor 210 maydetermine whether to use the tuning code and the ground code identifiedthrough the first measurement. As an example, the second measurementbased on the result of the first measurement may include a measuringmethod for identifying the impedance of the antenna 260 in a state wherethe impedance matching module 240 and the ground control module 250 areconfigured by the tuning code and the ground code identified through thefirst measurement. As an example, whether to use the tuning code and theground code identified through the first measurement may be determinedbased on a distance between coordinates of the antenna impedanceidentified through the second measurement based on the result of thefirst measurement and coordinates of at least one reference impedance.For example, if it is determined that the processor 210 uses the tuningcode and the ground code identified through the first measurement, theprocessor 210 may control the impedance matching module 240 and/or theground control module 250 so as to match the antenna impedance based onthe tuning code and the ground code identified through the firstmeasurement. As another example, if it is determined that the processor210 does not use the tuning code and the ground code identified throughthe first measurement, the processor 210 may update at least one of thetuning code or the ground code through additional second measurement. Asan example, the additional second measurement may include aconfiguration to identify the antenna impedance in a state where thetuning code of the impedance matching module 240 is configured as thereference code and the ground code of the ground control module 250 isconfigured as the ground code corresponding to the first index. As anexample, the additional second measurement may be performed in case thatthe index obtained through the first measurement is equally maintained.

According to various embodiments, the processor 210 may configure aplurality of reference impedances (e.g., two reference impedances) formatching the antenna impedance by applying the tuning code to theimpedance matching module 240. According to an embodiment, the processor210 may configure G0 coordinates 400 corresponding to 50 ohms and G1coordinates 410 at which the highest transmission power (e.g., 24.8 dBm)is measured as reference impedances as shown in FIG. 4. As an example,the transmission power corresponding to each index may be measured basedon the switch 230. As an example, the plural reference impedances may beused as references for matching the antenna impedance, or may be used asa reference for selecting the tuning code of the impedance matchingmodule 240.

According to various embodiments, the wireless communication module 220may include a transceiver, an amplification module, and a front endmodule (FEM). According to an embodiment, the transceiver may convertdata provided from the processor 210 (e.g., communication processor)into an RF signal (e.g., transmission (Tx) signal), and may output theRF signal to the front end module (FEM) through the amplificationmodule. Further, the transceiver may convert the RF signal (e.g.,reception (Rx) signal) received from the front end module (FEM) intodigital data that can be deciphered by the processor 210, and maytransfer the digital data to the processor 210. According to anembodiment, the amplification module may include a power amplifier and alow-noise amplifier. The power amplifier may amplify the power of the RFsignal (e.g., Tx signal) being provided from the transceiver, and maytransmit the amplified power to the front end module (FEM). Thelow-noise amplifier may amplify the power of the RF signal (e.g., Rxsignal) provided from the front end module (FEM) while minimizing thenoise of the RF signal, and may transmit the RF signal to thetransceiver. According to an embodiment, the front end module (FEM) mayinclude a duplexer and/or a diplexer, and may separately output thetransmission and reception signals. As an example, the front end module(FEM) may output the RF signal (e.g., Tx signal) provided from thetransceiver through an input port to the antenna 260 throughinput/output ports, and may output the RF signal (e.g., Rx signal)provided from the antenna 260 through the input/output ports to thetransceiver through the output port.

According to various embodiments, the switch 230 may connect thewireless communication module 220 to at least one antenna 260. Accordingto an embodiment, the switch 230 may connect the antenna 260 to be usedfor the wireless communication among the at least one antenna 260 to thewireless communication module 220.

According to various embodiments, the impedance matching module 240 mayadjust the impedance of the antenna 260 to be close to the at least onereference impedance based on the tuning code selected by the processor210. As an example, the impedance matching module 240 may include atleast one of a resistor, an inductor, or a capacitor. For example, theimpedance matching module 240 may reduce reflection due to a differencein impedance between the antenna 260 and the wireless communicationmodule 220 by adjusting an electrical length (e.g., capacitor, inductor,or resistor) between the antenna 260 and the wireless communicationmodule 220 based on the tuning code.

According to various embodiments, the ground control module 250 maychange a resonance frequency by adjusting the electrical length betweenthe antenna 260 and the ground based on the ground code selected by theprocessor 210. The ground control module 250 may reduce the reflectionoccurring due to the impedance difference between the antenna 260 andthe wireless communication module 220 through the change of theresonance frequency. As an example, the ground code may be selectedbased on the first measurement or the additional second measurement.

According to various embodiments, an electronic device (e.g., electronicdevice 101 of FIG. 1 or electronic device 200 of FIG. 2) may include anantenna (e.g., antenna 260 of FIG. 2), a wireless communication module(e.g., wireless communication module 220 of FIG. 2), an impedancematching module (e.g., impedance matching module 240 of FIG. 2)electrically connected to the antenna and the wireless communicationmodule, and at least one processor (e.g., processor 210 of FIG. 2)operatively connected to the impedance matching module and the wirelesscommunication module, wherein the at least one processor may beconfigured to: select a first index corresponding to an impedance of theantenna among a plurality of sampled indexes through a first measurementin which a tuning code of the impedance matching module is configured asa reference code, identify a use environment corresponding to the firstindex, select a second index corresponding to the impedance of theantenna among the plurality of sampled indexes through a secondmeasurement in which the tuning code of the impedance matching module isconfigured as the reference code and as a ground code corresponding tothe use environment, and adjust the impedance of the antenna based on atuning code corresponding to the second index.

According to various embodiments, the plurality of sampled indexes mayinclude 96 indexes corresponding to different impedances.

According to various embodiments, at least one adjacent index of theplurality of sampled indexes may be grouped by use environments.

According to various embodiments, the at least one processor may beconfigured to identify the impedance of the antenna through the firstmeasurement and the second measurement in the same period.

According to various embodiments, the at least one processor may beconfigured to adjust a length of a ground connected to the antenna basedon the ground code corresponding to the use environment.

According to various embodiments, an electronic device (e.g., electronicdevice 101 of FIG. 1 or electronic device 200 of FIG. 2) may include anantenna (e.g., antenna 260 of FIG. 2), a wireless communication module(e.g., wireless communication module 220 of FIG. 2), an impedancematching module (e.g., impedance matching module 240 of FIG. 2)electrically connected to the antenna and the wireless communicationmodule, and at least one processor (e.g., processor 210 of FIG. 2)operatively connected to the impedance matching module and the wirelesscommunication module, wherein the at least one processor may beconfigured to: select a first index corresponding to a first impedanceof the antenna identified through a first measurement, in which a tuningcode of the impedance matching module is configured as a reference code,among a plurality of sampled indexes, identify a use environmentcorresponding to the first index, identify a second impedance of theantenna through a second measurement in which the tuning code of theimpedance matching module is configured as a tuning code correspondingto the first index and as a ground code corresponding to the useenvironment, and adjust the impedance of the antenna based on the tuningcode corresponding to the first index in case that a distance betweenthe second impedance and a reference impedance satisfies a designatedcondition.

According to various embodiments, the plurality of sampled indexes mayinclude 96 indexes corresponding to different impedances, and at leastone adjacent index may be grouped by use environments.

According to various embodiments, the at least one processor may beconfigured to: update the tuning code based on a result of the secondmeasurement in which the tuning code of the impedance matching module isconfigured as the reference code and as the ground code corresponding tothe use environment in case that the distance between the secondimpedance and the reference impedance does not satisfy the designatedcondition, and adjust the impedance of the antenna based on the updatedtuning code.

According to various embodiments, the at least one processor may beconfigured to adjust a length of a ground connected to the antenna basedon the ground code corresponding to the use environment.

According to various embodiments, the reference impedance may include atleast one of inphase (I)/quadrature (Q) information corresponding to 50ohms or I/Q information having the highest transmission power.

FIG. 5 is a flowchart 500 in which an electronic device according tovarious embodiments matches an antenna impedance. In the followingembodiments, respective operations may be sequentially performed, but itmay not be necessary that the operations are sequentially performed. Forexample, the order of the respective operations may be changed, or atleast two of the operations may be performed in parallel. Here, theelectronic device may be the electronic device 101 of FIG. 1 or theelectronic device 200 of FIG. 2. Hereinafter, at least parts of theoperations of FIG. 5 will be described with reference to FIG. 6, 7, or8. FIG. 6 is a graph for selecting a tuning code according to variousembodiments. FIG. 7 is a graph illustrating a use environment of anelectronic device according to various embodiments. FIG. 8 is a diagramillustrating a period for measuring an antenna impedance according tovarious embodiments.

With reference to FIG. 5, according to various embodiments, at operation501, an electronic device (e.g., processor 120 of FIG. 1 or processor210 of FIG. 2) may perform a first measurement in which a tuning code ofan impedance matching module is configured as a reference code toidentify an impedance change of an antenna. According to an embodiment,the processor 210 may perform the first measurement in a state where thetuning code of the impedance matching module 240 is configured as thereference code (e.g., bypass code).

According to various embodiments, at operation 503, the electronicdevice (e.g., processor 120 or 210) may identify a first indexcorresponding to the result of the first measurement. According to anembodiment, if an antenna impedance 600 is identified through the firstmeasurement as shown in FIG. 6, the processor 210 may select index 76that is closest to the antenna impedance 600 among 96 sampled indexes.According to an embodiment, if an antenna impedance 610 is identifiedthrough the first measurement as shown in FIG. 6, the processor 210 mayselect index 77 having the shortest distance to the antenna impedance610 among the 96 sampled indexes.

According to various embodiments, at operation 505, the electronicdevice (e.g., processor 120 or 210) may perform a second measurementbased on the ground code corresponding to the first index. According toan embodiment, as shown in FIG. 7, 96 sampled indexes may be dividedinto a plurality of areas 702, 704, 706, 708, and 710 corresponding touse environments. For each area 702, 704, 706, 708, or 710, at least oneground code (or range) corresponding to the use environment and apriority may be defined. As an example, the user environment may includeat least one of a right-side contact state (R-segment) 702, a hand gripstate 704, a left-side contact state (L-segment) 706, a universal serialbus (USB) insertion state 708, or an earphone (E/P) insertion state 710.According to an embodiment, the processor 210 may perform the secondmeasurement in a state where the code of the ground control module 250is configured as the ground code corresponding to the first index. As anexample, the ground code corresponding to the first index may include aground code having the highest priority among at least one ground codedefined in the use environment including the first index. As an example,during the second measurement, the tuning code of the impedance matchingmodule 240 may be configured as the reference code in the same manner asthe first measurement.

According to various embodiments, at operation 507, the electronicdevice (e.g., processor 120 or 210) may identify the second indexcorresponding to the result of the second measurement. According to anembodiment, if the antenna impedance 602 is identified through thesecond measurement as shown in FIG. 6, the processor 210 may selectindex 19 that is closest to the antenna impedance 602 among the 96sampled indexes. According to an embodiment, if the antenna impedance612 is identified through the second measurement as shown in FIG. 6, theprocessor 210 may select index 24 having the shortest distance to theantenna impedance 612 among the 96 sampled indexes.

According to various embodiments, at operation 509, the electronicdevice (e.g., processor 120 or 210) may select a tuning codecorresponding to the second index. According to an embodiment, the 96sampled indexes defined as shown in FIG. 3B may include predefinedtuning codes corresponding to the respective indexes. Accordingly, theprocessor 210 may identify the predefined tuning code in the index(e.g., index 19 or index 24 of FIG. 6) corresponding to the result ofthe second measurement.

According to various embodiments, at operation 511, the electronicdevice (e.g., processor 120 or 210 and/or impedance matching module 240)may adjust the antenna impedance based on the tuning code correspondingto the second index for matching of the antenna impedance. According toan embodiment, the impedance matching module 240 may adjust anelectrical length between the antenna 260 and the wireless communicationmodule 220 so that the antenna impedance matches the reference impedancebased on the tuning code corresponding to the second index selected bythe processor 210. As an example, the impedance matching module 240 mayadjust the antenna impedance so that the antenna impedance becomes closeto the reference impedance based on the tuning code corresponding toindex 19 obtained through the second measurement as shown in FIG. 6(604). As an example, the impedance matching module 240 may adjust theantenna impedance so that the antenna impedance becomes close to thereference impedance based on the tuning code corresponding to index 24obtained through the second measurement as shown in FIG. 6 (614).According to an embodiment, the ground control module 250 may adjust theelectrical length between the antenna 260 and the ground based on theground code corresponding to the first index selected by the processor210.

According to various embodiments, the electronic device (e.g., processor120 or 210) may identify the antenna impedance through the firstmeasurement 801 and the second measurement 803 in one period 800 asshown in FIG. 8. If the electronic device determines to change thetuning code through the first measurement 801 and/or the secondmeasurement 803, the electronic device may change the tuning code aftertwo periods (811). As an example, one period 800 may include two-timetransmission time intervals (TTI) (about one second).

FIG. 9 is a flowchart 900 in which an electronic device according tovarious embodiments updates a tuning code. In the following embodiments,respective operations may be sequentially performed, but it may not benecessary that the operations are sequentially performed. For example,the order of the respective operations may be changed, or at least twoof the operations may be performed in parallel. Here, the electronicdevice may be the electronic device 101 of FIG. 1 or the electronicdevice 200 of FIG. 2.

With reference to FIG. 9, according to various embodiments, theelectronic device (e.g., processor 120 of FIG. 1 or processor 210 ofFIG. 2), at operation 901, may identify the antenna impedance throughthe first measurement in a state where the tuning code for impedancematching is configured as the reference code. According to anembodiment, the processor 210 may perform the first measurement foridentifying the change of the antenna impedance in a state where thetuning code of the impedance matching module 240 is configured as thereference code (e.g., bypass code).

According to various embodiments, at operation 903, the electronicdevice (e.g., processor 120 or 210) may identify the first indexcorresponding to the antenna impedance identified through the firstmeasurement. According to an embodiment, as shown in FIG. 3B, theprocessor 210 may select any one index having the shortest distance tothe antenna impedance identified through the first measurement among 96sampled indexes as the first index.

According to various embodiments, at operation 905, the electronicdevice (e.g., processor 120 or 210) may perform the second measurementbased on the tuning code and the ground code corresponding to the firstindex. According to an embodiment, the processor 210 may identify theantenna impedance by performing the second measurement in a state wherethe code of the impedance matching module 240 is configured as thetuning code corresponding to the first index and the code of the groundcontrol module 250 is configured as the ground code corresponding to thefirst index. As an example, the second measurement may be performed inthe same period as or in the next period to the period of the firstmeasurement performed at operation 901. The second measurement may beperformed in a state where the first index identified through the firstmeasurement is equally maintained. As an example, the ground codecorresponding to the first index may include a ground code having thehighest priority among at least one ground code defined in the useenvironment in which the first index is included.

According to various embodiments, at operation 907, the electronicdevice (e.g., processor 120 or 210) may identify whether the result ofthe second measurement satisfies the reference condition related to theantenna impedance matching. According to an embodiment, the processor210 may identify whether the distance between the antenna impedanceidentified through the second measurement and at least one referenceimpedance is equal to or shorter than the reference distance. As anexample, if G0 400 and G1 410 are configured as reference impedances asshown in FIG. 4, the processor 210 may compare an average of the antennaimpedance as the result of the second measurement and the distancebetween the G0 400 and G1 410 with the reference distance. As anexample, in case of applying the tuning code corresponding to the index,the reference distance may be configured as a distance capable ofincluding at least one index being determined so that the antennaimpedance matches at least one reference impedance.

According to various embodiments, at operation 909, the electronicdevice (e.g., processor 120 or 210 and/or impedance matching module 240)may match the antenna impedance with the tuning code corresponding tothe first index in case that the result of the second measurement basedon the first index is determined to satisfy the reference conditionrelated to the antenna impedance matching (e.g., “Yes” of operation907). According to an embodiment, if the distance between the antennaimpedance identified through the second measurement based on the firstindex and the at least one reference impedance is equal to or shorterthan the reference distance, the processor 210 may determine that theresult of the second measurement based on the first index satisfies thereference condition related to the antenna impedance matching.Accordingly, the processor 210 may select the tuning code and the groundcode corresponding to the first index as variables for matching theantenna impedance. According to an embodiment, the impedance matchingmodule 240 may adjust the electrical length between the antenna 260 andthe wireless communication module 220 so that the antenna impedancematches the reference impedance based on the tuning code correspondingto the first index selected by the processor 210. According to anembodiment, the ground control module 250 may adjust the electricallength between the antenna 260 and the ground based on the ground codecorresponding to the first index selected by the processor 210.

According to various embodiments, if it is determined that the result ofthe second measurement based on the first index does not satisfy thereference condition related to the antenna impedance matching (e.g.,“No” of operation 907), the electronic device (e.g., processor 120 or210), at operation 911, may update the tuning code for matching theantenna impedance based on the additional second measurement. Accordingto an embodiment, if the distance between the antenna impedanceidentified through the second measurement based on the first index andthe at least one reference impedance exceeds the reference distance, theprocessor 210 may determine that the result of the second measurementbased on the first index does not satisfy the reference conditionrelated to the antenna impedance matching. If the next period arrives,the processor 210 may determine the tuning code to be applied to theimpedance matching module 240 for matching the antenna impedance throughthe additional second measurement. As an example, the additional secondmeasurement may include the configuration to identify the antennaimpedance in a state where the tuning code of the impedance matchingmodule 240 is configured as the reference code and the ground code ofthe ground control module 250 is configured as the ground codecorresponding to the first index. As an example, the additional secondmeasurement may be performed in case that the first index obtainedthrough the first measurement in the next period is equal to the firstindex identified in the previous period.

According to various embodiments, at operation 913, the electronicdevice (e.g., processor 120 or 210) may match the antenna impedance withthe tuning code updated based on the additional second measurement.According to an embodiment, the processor 210 may select the secondindex corresponding to the antenna impedance identified through theadditional second measurement. The processor 210 may select the tuningcode predefined in the second index as the tuning code for matching theantenna impedance. The impedance matching module 240 may adjust theelectrical length between the antenna 260 and the wireless communicationmodule 220 so that the antenna impedance matches the reference impedancebased on the tuning code corresponding to the second index selected bythe processor 210. According to an embodiment, the ground control module250 may adjust the electrical length between the antenna 260 and theground based on the ground code corresponding to the first indexselected by the processor 210. As an example, the ground codecorresponding to the first index selected by the processor 210 may bedetermined based on the result of the second measurement to which atleast one ground code defined in the use environment including the firstindex is applied.

FIG. 10 is a flowchart 1000 in which an electronic device according tovarious embodiments determines whether to use a tuning codecorresponding to a first measurement. Operations of FIG. 10 to bedescribed hereinafter may be detailed operations of the operations 905to 907 of FIG. 9. In the following embodiments, the respectiveoperations may be sequentially performed, but it may not be necessarythat the operations are sequentially performed. For example, the orderof the respective operations may be changed, or at least two of theoperations may be performed in parallel. Here, the electronic device maybe the electronic device 101 of FIG. 1 or the electronic device 200 ofFIG. 2.

With reference to FIG. 10, according to various embodiments, theelectronic device (e.g., processor 120 of FIG. 1 or processor 210 ofFIG. 2), at operation 1001, may perform the second measurementconfigured as the ground code and the tuning code corresponding to thefirst index in case that the first index corresponding to the antennaimpedance identified through the first measurement is identified (e.g.,operation 903 of FIG. 9). According to an embodiment, the processor 210may perform the second measurement based on the first index in the sameperiod as the period of the first measurement performed at operation 901of FIG. 9. According to another embodiment, the processor 210 mayperform the second measurement based on the first index in the nextperiod of the first measurement performed at operation 901 of FIG. 9.The second measurement based on the first index may be performed in casethat the first index of the first measurement in the next period isequal to the first index of the first measurement in the previousperiod. As an example, the ground code corresponding to the first indexmay include a ground code having the highest priority among at least oneground code defined in the use environment in which the first index isincluded.

According to various embodiments, at operation 1003, the electronicdevice (e.g., processor 120 or 210) may identify the distance betweenthe antenna impedance identified through the second measurement and atleast one reference impedance. According to an embodiment, if tworeference impedances 400 and 410 are configured as shown in FIG. 4, theprocessor 210 may calculate an average of the antenna impedanceidentified through the second measurement and the distance between G0400 and G1 410.

According to various embodiments, at operation 1005, the electronicdevice (e.g., processor 120 or 210) may identify whether the distancebetween the antenna impedance and the reference impedance is equal to orshorter than the reference distance. As an example, the referencedistance may be configured as a distance capable of including at leastone index being determined so that the antenna impedance adjusted byapplying the tuning code corresponding to the index matches at least onereference impedance.

According to various embodiments, at operation 1007, the electronicdevice (e.g., processor 120 or 210) may determine that the result of thesecond measurement based on the first index satisfies the referencecondition related to the antenna impedance matching in case that thedistance between the antenna impedance and the reference impedance isequal to or shorter than the reference distance (e.g., “Yes” ofoperation 1005). According to an embodiment, if it is determined thatthe result of the second measurement based on the first index satisfiesthe reference condition related to the antenna impedance matching, theprocessor 210 may match the antenna impedance based on the tuning codecorresponding to the first index as at operation 909 of FIG. 9.

According to various embodiments, if the distance between the antennaimpedance and the reference impedance exceeds the reference distance(e.g., “No” of operation 1005), the electronic device (e.g., processor120 or 210), at operation 1009, may determine that the result of thesecond measurement based on the first index does not satisfy thereference condition related to the antenna impedance matching. Accordingto an embodiment, if it is determined that the result of the secondmeasurement based on the first index does not satisfy the referencecondition related to the antenna impedance matching, the processor 210may match the antenna impedance based on the tuning code updated basedon the additional second measurement as at operations 911 to 913 of FIG.9.

FIG. 11 is a flowchart 1100 in which an electronic device according tovarious embodiments selects a tuning code through a second measurement.Operations of FIG. 11 to be described hereinafter may be detailedoperations of the operations 911 to 913 of FIG. 9. In the followingembodiments, the respective operations may be sequentially performed,but it may not be necessary that the operations are sequentiallyperformed. For example, the order of the respective operations may bechanged, or at least two of the operations may be performed in parallel.Here, the electronic device may be the electronic device 101 of FIG. 1or the electronic device 200 of FIG. 2.

With reference to FIG. 11, according to various embodiments, theelectronic device (e.g., processor 120 of FIG. 1 or processor 210 ofFIG. 2), at operation 1101, may identify whether the first indexcorresponding to the antenna impedance through the first measurement ismaintained if it is determined that the result of the second measurementbased on the first index does not satisfy the reference condition (e.g.,“No” of operation 907 of FIG. 9). According to an embodiment, if thek-th period for measuring the antenna impedance arrives, the processor210 may identify the antenna impedance through the first measurement.The processor 210 may identify whether the first index corresponding tothe antenna impedance identified through the first measurement is equalto the first index obtained through the first measurement in the(k−1)-th period (i.e., previous period).

According to various embodiments, if the first index is changed (e.g.,“No” of operation 1101), the electronic device (e.g., processor 120 or210) may determine that the update of the tuning code is unnecessary.According to an embodiment, if the first index is changed, the processor210 may determine whether to use the tuning code corresponding to thefirst index through the second measurement based on the first index asat operations 905 to 913 of FIG. 9.

According to various embodiments, at operation 1103, the electronicdevice (e.g., processor 120 or 210) may identify the use environmentcorresponding to the first index if the first index is maintained (e.g.,“Yes” of operation 1101). According to an embodiment, 96 sampled indexesmay be divided into a plurality of areas 702, 704, 706, 708, and 710corresponding to the use environment as shown in FIG. 7. Accordingly,the processor 210 may identify the use environment of the electronicdevice 200 including the first index.

According to various embodiment, at operation 1105, the electronicdevice (e.g., processor 120 or 210) may perform the second measurementbased on the i-th ground code in a ground set corresponding to the useenvironment of the electronic device 200. According to an embodiment,each of the areas 702, 704, 706, 708, and 710 corresponding to the useenvironment may define at least one ground code corresponding to theuser environment. The processor 210 may perform the second measurementin a state where the code of the ground control module 250 is configuredas the i-th ground code in the ground set including at least one groundcode corresponding to the use environment of the electronic device 200.As an example, “i” is the priority of the ground code included in theground set, and may be defined as a natural number. As an example, thesecond measurement may be performed in a state where the impedancematching module 240 is configured as the reference code. As an example,the second measurement being performed in a state where the code of theimpedance matching module 240 is configured as the reference code andthe code of the ground control module 250 is configured as the groundcode corresponding to the use environment may be called the additionalsecond measurement.

According to various embodiments, at operation 1107, the electronicdevice (e.g., processor 120 or 210) may identify the magnitude of theantenna impedance identified through the second measurement. Accordingto an embodiment, the 96 sampled indexes may include magnitude values of0.2, 0.4, 0.6, 0.8, and 1.0 configured based on the distance to at leastone reference impedance as shown in FIG. 3B. The processor 210 mayidentify the magnitude of the antenna impedance based on inphase(I)/quadrature phase (Q) information of the antenna impedance identifiedthrough the second measurement.

According to various embodiments, at operation 1109, the electronicdevice (e.g., processor 120 or 210) may identify whether the magnitudeof the antenna impedance identified through the second measurement isreduced. According to an embodiment, the processor 210 may identifywhether the magnitude of the antenna impedance obtained through thesecond measurement based on the i-th ground code is smaller than thereference magnitude. As an example, the reference magnitude may beconfigured as the magnitude of the antenna impedance obtained throughthe second measurement based on the previous (e.g., (i−1)-th) groundcode, and as an initial value, the magnitude of the antenna impedanceobtained through the second measurement performed at operation 905 ofFIG. 9 may be configured.

According to various embodiments, if the magnitude of the antennaimpedance identified through the second measurement is reduced (e.g.,“Yes” of operation 1109), the electronic device (e.g., processor 120 or210), at operation 1111, may identify the second index corresponding tothe result of the second measurement. According to an embodiment, theprocessor 210 may select the index having the shortest distance to theantenna impedance identified through the second measurement among theplurality of (e.g., 96) sampled indexes as the second index.

According to various embodiments, at operation 1113, the electronicdevice (e.g., processor 120 or 210) may perform the second measurementbased on the tuning code corresponding to the second index and the i-thground code. According to an embodiment, if the (k+2)-th period arrives,the processor 210 may identify whether the first index is maintainedthrough the first measurement. If the first index is maintained, theprocessor 210 may identify the antenna impedance by performing thesecond measurement in a state where the code of the impedance matchingmodule 240 is configured as the tuning code corresponding to the secondindex and the code of the ground control module 250 is configured as thei-th ground code.

According to various embodiments, at operation 1115, the electronicdevice (e.g., processor 120 or 210) may identify whether the result ofthe second measurement satisfies the reference condition related to theantenna impedance matching. According to an embodiment, the processor210 may identify whether the distance between the antenna impedanceidentified through the second measurement and the at least one referenceimpedance is equal to or shorter than the reference distance. As anexample, the at least one reference impedance may include at least oneof G0 400 or G1 410 as shown in FIG. 4.

According to various embodiments, if it is determined that the result ofthe second measurement satisfies the reference condition related to theantenna impedance matching (e.g., “Yes” of operation 1115), theelectronic device (e.g., processor 120 or 210 and/or impedance matchingmodule 240), at operation 1117, may match the antenna impedance with thetuning code corresponding to the second index. According to anembodiment, if the distance between the antenna impedance identifiedthrough the second measurement and the at least one reference impedanceis equal to or shorter than the reference distance, the processor 210may determine that the result of the second measurement satisfies thereference condition related to the antenna impedance matching.Accordingly, the processor 210 may select the tuning code and the i-thground code corresponding to the second index as variables for matchingthe antenna impedance. The impedance matching module 240 may adjust theantenna impedance based on the tuning code corresponding to the secondindex selected by the processor 210. The ground control module 250 mayadjust the length of the ground related to resonance of the antenna 260based on the i-th ground code selected by the processor 210.

According to various embodiments, if it is determined that the magnitudeof the antenna impedance identified through the second measurement isnot reduced (e.g., “No” of operation 1109) or the result of the secondmeasurement does not satisfy the reference condition related to theantenna impedance matching (e.g., “No” of operation 1115), theelectronic device (e.g., processor 120 or 210), at operation 1119, mayupdate the i that indicates the priority of the ground code. As anexample, the i may be increased by one step (i++).

According to various embodiments, at operation 1121, the electronicdevice (e.g., processor 120 or 210) may identify whether the updated iis equal to or smaller than the maximum value i_(MAX). As an example,the maximum value of i may be configures as the number of ground codesincluded in a ground set corresponding to the use environment of theelectronic device 200.

According to various embodiments, if the updated i is equal to orsmaller than the maximum value i_(MAX) of the i (e.g., “Yes” ofoperation 1121), the electronic device (e.g., processor 120 or 210) mayproceed with operation 1105, and may perform the second measurementbased on the ground code corresponding to the updated i.

According to various embodiments, if the updated i exceeds the maximumvalue i_(MAX) of the i (e.g., “No” of operation 1121), the electronicdevice (e.g., processor 120 or 210), at operation 1123, may select thesecond index based on the antenna impedance having the shortest distanceto the reference impedance among the antenna impedances identifiedthrough the second measurement in a state where the respective codes areconfigured as the ground codes. As an example, if a plurality ofreference impedances are provided, the distance to the referenceimpedance may include an average of the distances between the respectivereference impedances and the antenna impedances.

According to various embodiments, if the second index is selected basedon the distance to the reference impedance at operation 1117 (e.g.,operation 1123), the electronic device (e.g., processor 120 or 210and/or impedance matching module 240) may match the antenna impedancewith the tuning code corresponding to the second index.

According to various embodiments, the electronic device may configurethe tuning code and the ground code related to the antenna impedancematching through the second measurement in a state where the first indexcorresponding to the result of the first measurement is maintained.According to an embodiment, if the first index corresponding to theresult of the first measurement is changed, the electronic device maydetermine the tuning code for matching the antenna impedance throughoperations 901 to 913 of FIG. 9.

According to various embodiments, in case of updating at least one ofthe tuning code or the ground code based on the second measurement, theelectronic device may update at least one of the tuning code or theground code defined in the first index corresponding to the result ofthe first measurement with the tuning code or the i-th ground codecorresponding to the second index.

FIG. 12 is a flowchart in which an electronic device according tovarious embodiments configures a tuning code based on a received signalstrength. Operations of FIG. 12 to be described hereinafter may bedetailed operations of the operation 909 of FIG. 9 or the operation 1117of FIG. 11. In the following embodiments, the respective operations maybe sequentially performed, but it may not be necessary that theoperations are sequentially performed. For example, the order of therespective operations may be changed, or at least two of the operationsmay be performed in parallel. Here, the electronic device may be theelectronic device 101 of FIG. 1.

With reference to FIG. 12, according to various embodiments, theelectronic device (e.g., processor 120 of FIG. 1 or processor 210 ofFIG. 2), at operation 1201, may identify the strength of a receivedsignal in a state where the tuning code corresponding to the first indexcorresponding to the result of the first measurement or the second indexcorresponding to the result of the second measurement is applied.According to an embodiment, if it is determined that the result of thesecond measurement based on the first index satisfies the referencecondition related to the antenna impedance matching (e.g., “Yes” ofoperation 907 of FIG. 9), the processor 210 may identify the strength ofthe received signal in the state where the tuning code predefined in thefirst index is applied to the impedance matching module 240. Accordingto an embodiment, if it is determined that the result of the additionalsecond measurement satisfies the reference condition related to theantenna impedance matching (e.g., “Yes” of operation 1115 of FIG. 11),the processor 210 may identify the strength of the received signal inthe state where the tuning code predefined in the second index isapplied to the impedance matching module 240. As an example, thestrength of the received signal may include at least one of a receivedsignal strength indication (RSSI), a reference signal received power(RSRP), or a reference signal received quality (RSRQ).

According to various embodiments, at operation 1203, the electronicdevice (e.g., processor 120 or 210) may identify whether the identifiedstrength of the received signal is larger than the reference strength inthe state where the tuning code corresponding to the index is applied.As an example, the reference strength may include the strength of thereceived signal measured before changing the tuning code to the tuningcode corresponding to the index.

According to various embodiments, if the identified strength of thereceived signal is larger than the reference strength in the state wherethe tuning code corresponding to the index is applied (e.g., “Yes” ofoperation 1203), the electronic device (e.g., processor 120 or 210), atoperation 1205, may maintain the tuning code corresponding to the index.According to an embodiment, if the identified strength of the receivedsignal is larger than the reference strength in the state where thetuning code corresponding to the index is applied, the processor 210 maydetermine that the strength of the received signal is improved throughthe antenna impedance matching based on the corresponding tuning code.Accordingly, the processor 210 may control to maintain the tuning codeof the impedance matching module 240 with the tuning code correspondingto the index.

According to various embodiments, if the identified strength of thereceived signal is equal to or smaller than the reference strength(e.g., “No” of operation 1203) in the state where the tuning codecorresponding to the index is applied, the electronic device (e.g.,processor 120 or 210), at operation 1205, may restore the tuning codefor matching the antenna impedance to the tuning code used beforechanging the tuning code (i.e., previous tuning code). According to anembodiment, if the identified strength of the received signal is equalto or smaller than the reference strength in the state where the tuningcode corresponding to the index is applied, the processor 210 maydetermine that the strength of the received signal is not improvedthrough matching of the antenna impedance based on the correspondingtuning code. Accordingly, the processor 210 may change the tuning codeof the impedance matching module 240 to the tuning code used beforechanging to the tuning code corresponding to the index.

According to various embodiments, a method for operating an electronicdevice (e.g., electronic device 101 of FIG. 1 or electronic device 200of FIG. 2) may include: selecting a first index corresponding to animpedance of an antenna among a plurality of sampled indexes through afirst measurement in which a tuning code for impedance matching of theantenna is configured as a reference code; identifying a use environmentcorresponding to the first index; selecting a second index correspondingto the impedance of the antenna among the plurality of sampled indexesthrough a second measurement in which the tuning code for the impedancematching of the antenna is configured as the reference code and as aground code corresponding to the use environment; and adjusting theimpedance of the antenna based on a tuning code corresponding to thesecond index.

According to various embodiments, the plurality of sampled indexes mayinclude 96 indexes corresponding to different impedances.

According to various embodiments, at least one adjacent index of theplurality of sampled indexes may be grouped by use environments.

According to various embodiments, the first measurement and the secondmeasurement may be performed in a same period.

According to various embodiments, the method may further includeadjusting a length of a ground connected to the antenna based on theground code corresponding to the use environment.

According to various embodiments, a method for operating an electronicdevice (e.g., electronic device 101 of FIG. 1 or electronic device 200of FIG. 2) may include: selecting a first index corresponding to a firstimpedance of an antenna identified through a first measurement, in whicha tuning code for impedance matching of the antenna is configured as areference code, among a plurality of sampled indexes; identifying a useenvironment corresponding to the first index; identifying a secondimpedance of the antenna through a second measurement in which thetuning code for the impedance matching of the antenna is configured as atuning code corresponding to the first index and as a ground codecorresponding to the use environment; and adjusting the impedance of theantenna based on the tuning code corresponding to the first index incase that a distance between the second impedance and a referenceimpedance satisfies a designated condition.

According to various embodiments, wherein the plurality of sampledindexes may include 96 indexes corresponding to different impedances,and at least one adjacent index of the plurality of sampled indexes maybe grouped by use environments.

According to various embodiments, the method may further includes:updating the tuning code based on a result of the second measurement inwhich the tuning code of the impedance matching module is configured asthe reference code and as the ground code corresponding to the useenvironment in case that the distance between the second impedance andthe reference impedance does not satisfy the designated condition; andadjusting the impedance of the antenna based on the updated tuning code.

According to various embodiments, the method may further includeadjusting a length of a ground connected to the antenna based on theground code corresponding to the use environment.

According to various embodiments, the reference impedance may include atleast one of inphase (I)/quadrature (Q) information corresponding to 50ohms or I/Q information having a highest transmission power.

According to various embodiments of the disclosure, the electronicdevice can select the optimum tuning code for matching the antennaimpedance by selecting the tuning code for matching the antennaimpedance based on the ground code corresponding to the use environmentof the electronic device through the first measurement for identifyingthe antenna impedance and the second measurement for updating the tuningcode.

According to various embodiments of the disclosure, the electronicdevice can select the optimum tuning code for matching the antennaimpedance corresponding to the use environment of the electronic deviceby configuring a plurality of (e.g., two) reference impedances formatching the antenna impedance based on the transmission power.

Although the present disclosure has been described with variousembodiments, various changes and modifications may be suggested to oneskilled in the art. It is intended that the present disclosure encompasssuch changes and modifications as fall within the scope of the appendedclaims.

What is claimed is:
 1. An electronic device comprising: an antenna; awireless communication circuitry; an impedance matching circuitryelectrically connected to the antenna and the wireless communicationcircuitry; and at least one processor operatively connected to theimpedance matching circuitry and the wireless communication circuitry,wherein the at least one processor is configured to: select a firstindex corresponding to an impedance of the antenna among a plurality ofsampled indexes through a first measurement in which a tuning code ofthe impedance matching circuitry is configured as a reference code,identify a use environment corresponding to the first index, select asecond index corresponding to the impedance of the antenna among theplurality of sampled indexes through a second measurement in which thetuning code of the impedance matching circuitry is configured as thereference code and as a ground code corresponding to the useenvironment, and adjust the impedance of the antenna based on the tuningcode corresponding to the second index.
 2. The electronic device ofclaim 1, wherein the plurality of sampled indexes comprise 96 indexeseach of which corresponds to different impedance.
 3. The electronicdevice of claim 1, wherein at least one adjacent index of the pluralityof sampled indexes is grouped by use environments.
 4. The electronicdevice of claim 1, wherein the at least one processor is furtherconfigured to identify the impedance of the antenna through the firstmeasurement and the second measurement in a same period.
 5. Theelectronic device of claim 1, wherein the at least one processor isfurther configured to adjust a length of a ground connected to theantenna based on the ground code corresponding to the use environment.6. An electronic device comprising: an antenna; a wireless communicationcircuitry; an impedance matching circuitry electrically connected to theantenna and the wireless communication circuitry; and at least oneprocessor operatively connected to the impedance matching circuitry andthe wireless communication circuitry, wherein the at least one processoris configured to: select a first index corresponding to a firstimpedance of the antenna identified through a first measurement in whicha tuning code of the impedance matching circuitry is configured as areference code among a plurality of sampled indexes, identify a useenvironment corresponding to the first index, identify a secondimpedance of the antenna through a second measurement in which thetuning code of the impedance matching circuitry is configured as atuning code corresponding to the first index and as a ground codecorresponding to the use environment, and adjust an impedance of theantenna based on the tuning code corresponding to the first index incase that a distance between the second impedance and a referenceimpedance satisfies a designated condition.
 7. The electronic device ofclaim 6, wherein the plurality of sampled indexes comprise 96 indexeseach of which corresponds to different impedance, and at least oneadjacent index of the plurality of sampled indexes is grouped by useenvironments.
 8. The electronic device of claim 6, wherein the at leastone processor is configured to: update the tuning code based on a resultof the second measurement in which the tuning code of the impedancematching circuitry is configured as the reference code and as the groundcode corresponding to the use environment in case that the distancebetween the second impedance and the reference impedance does notsatisfy the designated condition, and adjust the impedance of theantenna based on the updated tuning code.
 9. The electronic device ofclaim 6, wherein the at least one processor is further configured toadjust a length of a ground connected to the antenna based on the groundcode corresponding to the use environment.
 10. The electronic device ofclaim 6, wherein the reference impedance comprises at least one ofinphase (I)/quadrature (Q) information corresponding to 50 ohms or I/Qinformation including a highest transmission power.
 11. A method foroperating an electronic device comprising: selecting a first indexcorresponding to an impedance of an antenna among a plurality of sampledindexes through a first measurement in which a tuning code for impedancematching of the antenna is configured as a reference code; identifying ause environment corresponding to the first index; selecting a secondindex corresponding to the impedance of the antenna among the pluralityof sampled indexes through a second measurement in which the tuning codefor the impedance matching of the antenna is configured as the referencecode and as a ground code corresponding to the use environment; andadjusting the impedance of the antenna based on the tuning codecorresponding to the second index.
 12. The method of claim 11, whereinthe plurality of sampled indexes comprise 96 indexes each of whichcorresponds to different impedance.
 13. The method of claim 11, whereinat least one adjacent index of the plurality of sampled indexes isgrouped by use environments.
 14. The method of claim 11, wherein thefirst measurement and the second measurement are performed to identifythe impedance of the antenna in a same period.
 15. The method of claim11, further comprising adjusting a length of a ground connected to theantenna based on the ground code corresponding to the use environment.16. A method for operating an electronic device comprising: selecting afirst index corresponding to a first impedance of an antenna identifiedthrough a first measurement in which a tuning code for impedancematching of the antenna is configured as a reference code among aplurality of sampled indexes; identifying a use environmentcorresponding to the first index; identifying a second impedance of theantenna through a second measurement in which the tuning code for theimpedance matching of the antenna is configured as a tuning codecorresponding to the first index and as a ground code corresponding tothe use environment; and adjusting the impedance of the antenna based onthe tuning code corresponding to the first index in case that a distancebetween the second impedance and a reference impedance satisfies adesignated condition.
 17. The method of claim 16, wherein the pluralityof sampled indexes comprise 96 indexes each of which corresponds todifferent impedance, and at least one adjacent index of the plurality ofsampled indexes is grouped by use environments.
 18. The method of claim16, further comprising: updating the tuning code based on a result ofthe second measurement in which the tuning code of the impedancematching of the antenna is configured as the reference code and as theground code corresponding to the use environment in case that thedistance between the second impedance and the reference impedance doesnot satisfy the designated condition; and adjusting the impedance of theantenna based on the updated tuning code.
 19. The method of claim 16,further comprising adjusting a length of a ground connected to theantenna based on the ground code corresponding to the use environment.20. The method of claim 16, wherein the reference impedance comprises atleast one of inphase (I)/quadrature (Q) information corresponding to 50ohms or I/Q information including a highest transmission power.